home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / Skel 3.0i / HQAE.p next >
Text File  |  1994-04-18  |  2KB  |  49 lines

  1. {Stripped-down AppleEvent unit, so we don't have to include all the other junk.}
  2. {When I see interface files like this, I wonder if someone is trying to make fools of us.}
  3. {Don't Apple know anything about making API's that are *simple* and easy to grasp?}
  4. {I suppose they want to make sure that our compilers are busy.}
  5.  
  6. unit AppleEvents;
  7. interface
  8.  
  9.     const
  10.         kHighLevelEvent = 23;
  11.         kCoreEventClass = 'aevt';
  12.  
  13.         kAEOpenApplication = 'oapp';
  14.         kAEOpenDocuments = 'odoc';
  15.         kAEPrintDocuments = 'pdoc';
  16.         kAEQuitApplication = 'quit';
  17.         keyMissedKeywordAttr = 'miss';      { this attribute is read only }
  18.         typeWildCard = '****';
  19.         errAEDescNotFound = -1701;
  20.         errAEParamMissed = -1715;           { a required parameter was not accessed }
  21.         errAEEventNotHandled = -1708;       { The AppleEvent was not handled by any handler }
  22.  
  23.     type
  24.         AEKeyword = packed array[1..4] of CHAR;
  25.         AEEventClass = packed array[1..4] of CHAR;
  26.         AEEventID = packed array[1..4] of CHAR;
  27.         DescType = ResType;
  28.         AEDesc = record
  29.                 descriptorType: DescType;
  30.                 dataHandle: Handle;
  31.             end;
  32.         AEAddressDesc = AEDesc;             { an AEDesc which contains addressing data }
  33.         AEDescList = AEDesc;                { a list of AEDesc is a special kind of AEDesc }
  34.         AERecord = AEDescList;              { AERecord is a list of keyworded AEDesc }
  35.         AppleEvent = AERecord;              { an AERecord that contains an AppleEvent }
  36.         EventHandlerProcPtr = ProcPtr;
  37.  
  38.     function AEGetAttributePtr (theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; var typeCode: DescType; dataPtr: Ptr; maximumSize: Size; var actualSize: Size): OSErr;
  39.     inline
  40.         $303C, $0E15, $A816;
  41.     function AEInstallEventHandler (theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: EventHandlerProcPtr; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  42.     inline
  43.         $303C, $091F, $A816;
  44.     function AEProcessAppleEvent (theEventRecord: EventRecord): OSErr;
  45.     inline
  46.         $303C, $021B, $A816;
  47.  
  48. implementation
  49. end.